<% title_tag t('teams.users') %>

<%= render '/teams/header' %>

<div class="card team-users">
  <div class="card-body">
    <% if can? :update, @team %>
      <div class="heading clearfix">
        <%= link_to t('teams.new_team_user'), new_user_team_user_path(@team), class: 'btn btn-success' %>
        <%= link_to t('teams.accept_all_req'), accept_all_path(@team), class: 'btn btn-primary' %>
      </div>
      <form action="<%= user_team_users_path(@team) %>" method="GET">
        <div class="row">
          <div class="col-lg-6">
            <div class="input-group">
              <input type="text" class="form-control" name="tq" type="text" value="<%= params[:tq] %>" placeholder="<%= t('teams.search_team_user') %>" />
              <span class="input-group-btn">
            <button class="btn btn-default" type="submit">Go!</button>
          </span>
            </div>
          </div>
        </div><!-- /input-group -->
      </form>
    <% end %>
    <% if @team_users.blank? %>
      <hr/>
      <div class="card-body">
        <div class="no-result">没有搜索到任何有关 <%= params[:tq] %> 的内容</div>
      </div>
    <% else %>
      <table class="table table-striped">
        <%= render partial: '/team_users/team_user', collection: @team_users %>
      </table>
    <% end %>
  </div>
  <div class="card-footer">
    <%= paginate @team_users %>
  </div>
</div>
